import java.util.Scanner;

public class PrimeNumbers
{
	public static void main( String[] args )
	{
		Scanner inputScanner = new Scanner( System.in );
		
		int inputNumber;
		
		try
		{
			inputNumber = inputScanner.nextInt();
		}
		catch( InputMismatchException e )
		{
			System.out.println("Input value is not correct. Try integral numbers above zero only.");
			return;
		}
		
		final int FIRST_PRIME_NUMBER = 2;
		
		//check if input number is above zero
		if ( inputNumber < 0 )
		{
			System.out.println("Input number is not valid. Try numbers above zero.");
		}
		else
		{
			boolean isPrime;
			//check each number before input number
			for (int i = FIRST_PRIME_NUMBER; i < inputNumber; i++)
			{
				//check if current number is prime
					isPrime = true;
					for (int j = FIRST_PRIME_NUMBER; j < i; j++)
					{
						if ( i % j == 0) isPrime = false;
					}
					if (isPrime) System.out.print( i + " ");
			}
			System.out.println();
		}
		
		inputScanner.close();
	}
}